<div class="row">
    <div class="col-md-3">
    </div>
    <div class="col-md-6">

        <div class="form">

            <?php $form = $this->beginWidget('CActiveForm', array(
                'id' => 'ideality-form',
                'enableAjaxValidation' => false,
                'htmlOptions' => array('enctype' => 'multipart/form-data'),
            )); ?>

            <p class="note">Fields with <span class="required">*</span> are required.</p>

            <p class="note"><b>Note:</b></p>

            <p class="note"><b>Partial price</b>: Project's materials and information will be kept visible on website
                after partial price payment is made. Each project can have multiple partial price transactions.</p>

            <p class="note"><b>Full price</b>: Project's materials and information will be removed from website after
                full price payment is made. Each project can only have 1 full price transaction.</p>
            <?php echo $form->errorSummary($model); ?>

            <div class="form-group">
                <?php echo $form->labelEx($model, 'title', array('class' => 'control-label')); ?>
                <?php echo $form->textField($model, 'title', array('size' => 50, 'class' => 'form-control')); ?>
                <?php echo $form->error($model, 'title'); ?>
            </div>

            <div class="form-group">
                <?php echo $form->labelEx($model, 'cate_id'); ?>
                <?php echo $form->dropDownList($model, 'cate_id', CHtml::listData(Category::model()->findAll(), 'id', 'title'), array('class' => 'form-control')); ?>
                <?php echo $form->error($model, 'cate_id'); ?>
            </div>


            <div class="form-group">
                <?php echo $form->labelEx($model, 'full_price'); ?>
                <?php echo $form->textField($model, 'full_price', array('size' => 50, 'class' => 'form-control')); ?>
                <?php echo $form->error($model, 'full_price'); ?>
            </div>

            <div class="form-group">
                <?php echo $form->labelEx($model, 'partly_price'); ?>
                <?php echo $form->textField($model, 'partly_price', array('size' => 50, 'class' => 'form-control')); ?>
                <?php echo $form->error($model, 'partly_price'); ?>
            </div>

            <div class="form-group">
                <?php echo $form->labelEx($model, 'short_description'); ?>
                <?php echo $form->textArea($model, 'short_description', array('rows' => 6, 'cols' => 50, 'class' => 'form-control')); ?>
                <?php echo $form->error($model, 'short_description'); ?>
            </div>

            <div class="form-group">
                <?php echo $form->labelEx($model, 'file_attach'); ?>
                <?php echo $form->fileField($model, 'file_attach', array('class' => 'filestyle')); ?>
                <?php echo $form->error($model, 'file_attach'); ?>


                    <?php  if($model->isNewRecord && $model->file_attach){$model->file_attach=null;} ?>
                 <?php  if(!$model->isNewRecord ){echo $model->file_attach;} ?>

            </div>

            <div class="row buttons">
                <?php echo CHtml::submitButton($model->isNewRecord ? 'Create' : 'Save', array('class' => 'btn btn-primary')); ?>
            </div>

            <?php $this->endWidget(); ?>
        </div>
    </div>
    <!-- form -->
    <div class='col-md-3'></div>
</div>